Skip to content

uv: set minimum numpy version to 2.0 (#810)#899

Merged
kennethshsu merged 1 commit into
casact:mainfrom
SaguaroDev:810-numpy-min-version
Jun 1, 2026
Merged

uv: set minimum numpy version to 2.0 (#810)#899
kennethshsu merged 1 commit into
casact:mainfrom
SaguaroDev:810-numpy-min-version

Conversation

@SaguaroDev
Copy link
Copy Markdown
Contributor

@SaguaroDev SaguaroDev commented Jun 1, 2026

Closes #810.

Running the suite on numpy 1.x breaks the unit tests, so the floor should be numpy 2.x. The existing dependency set already implies a 2.x-compatible window — numba caps numpy at <2.4, and pandas>=2.3.3 needs numpy>=1.26 on py3.12+ — but nothing pinned a 2.x floor explicitly. This sets it.

Change: "numpy""numpy>=2.0" in [project.dependencies].

Why 2.0 and not higher: 2.0 is the lowest numpy 2.x, it satisfies every transitive constraint in the dep tree (pandas, scikit-learn, sparse, numba, matplotlib all resolve against it), and requires-python>=3.10 is compatible with numpy 2.0+. Going higher would over-constrain without cause.

Verification (the "uv solves AND passes tests" check from the issue): I built an isolated env and pinned numpy to the floor (numpy==2.0.2). uv resolved the full environment cleanly, and at that floor the suite passes:

716 passed, 1 skipped, 12 xfailed in 133.41s

(At the floor the resolver also pulled pandas 3.0.3 / sparse 0.18 / numba 0.65.1, so the floor holds even against the newest pandas — not just the currently-pinned 2.3.3.)

I left uv.lock out of the diff so it regenerates in CI; happy to commit a refreshed lock if you'd prefer it in the PR.


Note

Low Risk
Packaging-only constraint change; no runtime or library code is modified.

Overview
Pins NumPy 2.x as the minimum runtime dependency by changing numpy to numpy>=2.0 in [project.dependencies] in pyproject.toml.

This aligns declared requirements with the stack the project already expects (tests fail on NumPy 1.x) without changing application code.

Reviewed by Cursor Bugbot for commit a822acc. Bugbot is set up for automated code reviews on this repo. Configure here.

Running the suite on numpy 1.x breaks tests, so the floor should be
numpy 2.x. The existing dependency set already implies a 2.x-compatible
window: numba caps numpy at <2.4 and pandas>=2.3.3 needs numpy>=1.26 on
py3.12+, but nothing pinned a 2.x floor explicitly.

Set 'numpy>=2.0'. Verified in an isolated env pinned to the floor
(numpy==2.0.2, which also pulled pandas 3.0.3 / sparse 0.18 / numba 0.65)
that uv solves the environment and the full suite passes: 716 passed,
1 skipped, 12 xfailed.

Closes casact#810.
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.90%. Comparing base (8a9a46e) to head (a822acc).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #899   +/-   ##
=======================================
  Coverage   86.90%   86.90%           
=======================================
  Files          87       87           
  Lines        4932     4932           
  Branches      624      624           
=======================================
  Hits         4286     4286           
  Misses        456      456           
  Partials      190      190           
Flag Coverage Δ
unittests 86.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kennethshsu kennethshsu merged commit ca138eb into casact:main Jun 1, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UV] Set minimum numpy version

3 participants